<!doctype html>
<html>
<head>
  <title>Popup for Proxy API Test</title>
  <link rel="stylesheet" type="text/css" href="./unittest.css">
  <script src="./jsunittest.js"></script>
  <script src="../proxy_form_controller.js"></script>
</head>
<body>
  <h1>Proxy Configuration Unit Tests</h1>

  <h2>ProxyFormController</h2>
  <div id="proxyformcontrollerlog"></div>

  <div id="fixture">
  <form id="proxyForm">
    <fieldset id="system">
      <legend>System Settings</legend>
      <input type="radio" name="proxyType" id="proxyTypeSystem" value="system">
      <label for="proxyTypeSystem">Use the <em>system's proxy settings</em>.</label>
    </fieldset>
    <fieldset id="direct">
      <legend>Direct Connection</legend>
      <input type="radio" name="proxyType" id="proxyTypeDirect" value="direct">
      <label for="proxyTypeDirect">Your computer is <em>directly connected</em> to the internet; no need for a proxy.</label>
    </fieldset>
    <fieldset id="pac_script">
      <legend>Automatic Configuration</legend>
      <input type="radio" name="proxyType" id="proxyTypeAutoconfig" value="autoconfig">
      <label for="proxyTypeAutoconfig">Your proxy supports <em>automatic configuration</em>.</label>

      <section>
        <label for="autoconfigURL">Autoconfiguration URL (PAC file)</label>
        <input type="url" name="autoconfigURL" id="autoconfigURL">
        <input type="hidden" name="autoconfigData" id="autoconfigData">
      </section>
    </fieldset>
    <fieldset id="fixed_servers">
      <legend>Manual Proxy</legend>
      <input type="radio" name="proxyType" id="proxyTypeManual" value="manual">
      <label for="proxyTypeManual">Configure your proxy settings <em>manually</em>.</label>
      <section>
        <fieldset>
          <legend>HTTP</legend>
          <label for="proxyHostHttp">Host</label>
          <select id="proxySchemeHttp" name="proxySchemeHttp">
            <option selected value="http">http://</option>
            <option value="https">https://</option>
            <option value="socks4">socks4://</option>
            <option value="socks5">socks5://</option>
          </select>
          <input type="text" name="proxyHostHttp" id="proxyHostHttp">

          <label for="proxyPortHttp">Port</label>
          <input type="number" min="1" step="1" name="proxyPortHttp" id="proxyPortHttp">

          <input type="checkbox" name="singleProxyForEverything" id="singleProxyForEverything">
          <label for="singleProxyForEverything">Use the same proxy server for all protocols</label>
        </fieldset>
        <fieldset>
          <legend>HTTPS</legend>
          <label for="proxyHostHttps">Host</label>
          <select id="proxySchemeHttps" name="proxySchemeHttps">
            <option selected value="http">http://</option>
            <option value="https">https://</option>
            <option value="socks4">socks4://</option>
            <option value="socks5">socks5://</option>
          </select>
          <input type="text" name="proxyHostHttps" id="proxyHostHttps">

          <label for="proxyPortHttps">Port</label>
          <input type="number" min="1" step="1" name="proxyPortHttps" id="proxyPortHttps">
        </fieldset>
        <fieldset>
          <legend>FTP</legend>
          <label for="proxyHostFtp">Host</label>
          <select id="proxySchemeFtp" name="proxySchemeFtp">
            <option selected value="http">http://</option>
            <option value="https">https://</option>
            <option value="socks4">socks4://</option>
            <option value="socks5">socks5://</option>
          </select>
          <input type="text" name="proxyHostFtp" id="proxyHostFtp">

          <label for="proxyPortFtp">Port</label>
          <input type="number" min="1" step="1" name="proxyPortFtp" id="proxyPortFtp">
        </fieldset>
        <fieldset>
          <legend>Fallback</legend>
          <label for="proxyHostFallback">Host</label>
          <select id="proxySchemeFallback" name="proxySchemeFallback">
            <option selected value="http">http://</option>
            <option value="https">https://</option>
            <option value="socks4">socks4://</option>
            <option value="socks5">socks5://</option>
          </select>
          <input type="text" name="proxyHostFallback" id="proxyHostFallback">

          <label for="proxyPortFallback">Port</label>
          <input type="number" min="1" step="1" name="proxyPortFallback" id="proxyPortFallback">
        </fieldset>
        <fieldset>
          <label for="bypassList">Bypass proxy for these hosts:</label>
          <textarea id="bypassList" name="bypassList" placeholder="localhost,192.168.1.1/16, .example.com"></textarea>
        </fieldset>
      </section>
    </fieldset>
    <input type="submit" value="Save proxy settings">
  </form>
  </div>
  <script src="./proxy_form_controller_test.js"></script>
</body>
</html>
